<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Dhara: src/mpienv.cc File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Dhara
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">mpienv.cc File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="main_8h_source.html">../include/main.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a4a19481ecee412fb5ec4fd04c90adb5d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mpienv_8cc.html#a4a19481ecee412fb5ec4fd04c90adb5d">InitializeMPI</a> (int *argc, char ***argv, int *rank, int *procsize)</td></tr>
<tr class="memdesc:a4a19481ecee412fb5ec4fd04c90adb5d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize MPI processes.  <a href="#a4a19481ecee412fb5ec4fd04c90adb5d">More...</a><br /></td></tr>
<tr class="separator:a4a19481ecee412fb5ec4fd04c90adb5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a24594871c51ae6b8ca2d6a8c7794d6b8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mpienv_8cc.html#a24594871c51ae6b8ca2d6a8c7794d6b8">FinalizeMPI</a> (int rank, int procsize, <a class="el" href="classmpi_class.html">mpiClass</a> *mpiobj)</td></tr>
<tr class="memdesc:a24594871c51ae6b8ca2d6a8c7794d6b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">: Close (finalize) the MPI environment  <a href="#a24594871c51ae6b8ca2d6a8c7794d6b8">More...</a><br /></td></tr>
<tr class="separator:a24594871c51ae6b8ca2d6a8c7794d6b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a715aa1cec1044e2e62a4c63ba65f0b13"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mpienv_8cc.html#a715aa1cec1044e2e62a4c63ba65f0b13">PartitionDomainToProcess</a> (int rank, int procsize, int *colx, int *xoffset, int *xdispls, int *xcounts, int *rowy, int *yoffset, int *ydispls, int *ycounts, int2 topolsize, int3 *globsize, MPI_Comm *cartComm)</td></tr>
<tr class="memdesc:a715aa1cec1044e2e62a4c63ba65f0b13"><td class="mdescLeft">&#160;</td><td class="mdescRight">Partitioning the entire domain to processes.  <a href="#a715aa1cec1044e2e62a4c63ba65f0b13">More...</a><br /></td></tr>
<tr class="separator:a715aa1cec1044e2e62a4c63ba65f0b13"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad0565c33ed351121f9cbd7bf1ddfbec8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mpienv_8cc.html#ad0565c33ed351121f9cbd7bf1ddfbec8">SetTopologyNetwork</a> (int rank, int procsize, <a class="el" href="class_project_class.html">ProjectClass</a> *&amp;project, <a class="el" href="classmpi_class.html">mpiClass</a> *&amp;mpiobj)</td></tr>
<tr class="memdesc:ad0565c33ed351121f9cbd7bf1ddfbec8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set up topolgy network (domain decomposition) and obtained neighbors. The size of topology must be matched with the size of MPI processes used.  <a href="#ad0565c33ed351121f9cbd7bf1ddfbec8">More...</a><br /></td></tr>
<tr class="separator:ad0565c33ed351121f9cbd7bf1ddfbec8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a24594871c51ae6b8ca2d6a8c7794d6b8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FinalizeMPI </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>rank</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>procsize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classmpi_class.html">mpiClass</a> *&#160;</td>
          <td class="paramname"><em>mpiobj</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>: Close (finalize) the MPI environment </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">rank</td><td>The global rank of the current MPI process </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">procsize</td><td>The total number of MPI processes available </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">mpiobj</td><td>message passing interface object class </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a4a19481ecee412fb5ec4fd04c90adb5d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void InitializeMPI </td>
          <td>(</td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>argc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char ***&#160;</td>
          <td class="paramname"><em>argv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>rank</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>procsize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize MPI processes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">argc</td><td>The number of command-line arguments </td></tr>
    <tr><td class="paramname">argv</td><td>The list of command-line arguments </td></tr>
    <tr><td class="paramname">rank</td><td>The global rank of the current MPI process </td></tr>
    <tr><td class="paramname">size</td><td>The total number of MPI processes available </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a715aa1cec1044e2e62a4c63ba65f0b13"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PartitionDomainToProcess </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>rank</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>procsize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>colx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>xoffset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>xdispls</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>xcounts</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>rowy</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>yoffset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>ydispls</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>ycounts</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int2&#160;</td>
          <td class="paramname"><em>topolsize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int3 *&#160;</td>
          <td class="paramname"><em>globsize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">MPI_Comm *&#160;</td>
          <td class="paramname"><em>cartComm</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Partitioning the entire domain to processes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">rank</td><td>The global rank of the current MPI process </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">procsize</td><td>The total number of MPI processes available </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">colx</td><td>Topology size in x (horizontal) direction </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">xoffset</td><td>Offset in x-direction </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">xdispls</td><td>Displacements in x-direction </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">xcounts</td><td>Counts in x-direction </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">rowy</td><td>Topology size in y (vertical) direction </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">yoffset</td><td>Offset in y-direction </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">ydispls</td><td>Displacements in y-direction </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">ycounts</td><td>Counts in y-direction </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">topolsize</td><td>Size of topology nodes (mpi) </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">globsize</td><td>Size of the global domain </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">cartComm</td><td>Carthesian MPI communicator </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ad0565c33ed351121f9cbd7bf1ddfbec8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int SetTopologyNetwork </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>rank</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>procsize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_project_class.html">ProjectClass</a> *&amp;&#160;</td>
          <td class="paramname"><em>project</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classmpi_class.html">mpiClass</a> *&amp;&#160;</td>
          <td class="paramname"><em>mpiobj</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set up topolgy network (domain decomposition) and obtained neighbors. The size of topology must be matched with the size of MPI processes used. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">rank</td><td>The global rank of the current MPI process </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">procsize</td><td>The total number of MPI processes available </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">project</td><td>Class including project info </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">mpiobj</td><td>message passing interface object class</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>function status </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
